<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // 正常走的reject 输出的是resolve状态
        // 执行完then和catch都会有一个输出状态,从而通过判断这个状态来继续进行下一步操作
        var p = Promise.reject(100).catch(res=>{
            console.log(res);
        }).catch(()=>{
            console.log(200);
        }).then(()=>{
            console.log(300);
            throw "err"
        }).catch(()=>{
            console.log(400);
        }).then(()=>{
            console.log(500);
        })
        console.log(p);
    </script>
</body>
</html>